﻿using System.Web.Mvc;

namespace ShopB2C.Controllers.Manager {
    public class ManagerAreasRouting : AreaRegistration {
        public override string AreaName {
            get { return "Manager"; }
        }

        public override void RegisterArea(AreaRegistrationContext context) {

            #region 分类

            context.MapRoute(
                "Manager_Class0",
                "Manager/Classify/{action}/{classifyParams}.aspx",
                new { Controller = "Classify" }
            );

            #endregion


            #region 商品相关

            // 商品咨询
            context.MapRoute(
                "Product_Consult",
                "Manager/Consult/{action}/{audit}-{productPage}-{productId}-{consultPage}-{consultId}.aspx",
                new {
                    controller = "Consult",
                    audit = "a",
                    productPage = 1,
                    consultPage = 1,
                    productId = 0,
                    consultId = 0
                }
            );
            // 商品评论
            context.MapRoute(
                "Product_Comment",
                "Manager/Comment/{action}/{audit}-{productPage}-{productId}-{commentPage}-{commentId}.aspx",
                new {
                    controller = "Comment",
                    audit = "a",
                    productPage = 1,
                    commentPage = 1,
                    productId = 0,
                    commentId = 0
                }
            );

            #endregion


            context.MapRoute(
                "Manager_default2",
                "Manager/{controller}/{action}/Page-{number}/{id}.aspx"
            );

            context.MapRoute(
                "Manager_default1",
                "Manager/{controller}/{action}/Page-{number}.aspx"
            );



            context.MapRoute(
                "Manager_default0",
                "Manager/{controller}/{action}/{id}.aspx"
            );

            context.MapRoute(
                "Manager_default",
                "Manager/{controller}/{action}.aspx"
            );
        }
    }
}
